/* styles.css */
body {
    font-family: Arial, sans-serif;
    margin: 0 auto;
    padding: 0;
    width: 90%;
    background-color: #f4f4f4;
}
p {
    margin: 0px;
}

.chat-container {
    display: flex;
    height: 100vh;
    border-radius: 5px;
    overflow-y: auto;
}

.history-panel {
    width: 200px;
    color: #000000;
    padding: 10px;
    margin-right:5px ;
    background-color: #f9f9f9;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    /*border-right: 1px solid #ddd;*/
}

.history-header {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.history-list {
    overflow-y: auto;
    height: calc(100vh - 50px);
}

.history-item {
    padding: 10px;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
}

.history-item:hover {
    background-color: #eff6ff;
}

.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
}

.chat-header {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    padding: 10px;
    /*border-bottom: 1px solid #ddd;*/
    position: sticky; /* 固定位置 */
    top: 0; /* 粘性定位的顶部偏移 */
    z-index: 10; /* 确保在最上层 */
    background-color: white; /* 防止背景透明导致文字不可见 */
}

.chat-messages {
    flex: 1;
    padding: 10px 10px;
    overflow-y: auto;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    margin-bottom: 10px;
    padding: 10px;
    word-wrap: break-word;
    position: relative;
}

/* AI消息样式 */
.ai-message {
    align-self: flex-start;
    background: white;
    color: #000000;
    border-radius: 15px;
    max-width: 90%;
    position: relative;
    margin-right: auto; /* 确保靠左对齐 */
    display: flex;
    align-items: center; /* 内容垂直居中 */
    word-wrap: break-word; /* 长单词或 URL 自动换行 */
    overflow-wrap: break-word; /* 新换行规则，适合现代浏览器 */
    white-space: pre-wrap; /* 保留换行符，并允许长内容换行 */
}


/* 用户消息样式 */
.user-message {
    background-color: #eff6ff;
    color: #000000;
    align-self: flex-end;
    border-radius: 15px;
    align-items: center; /* 内容垂直居中 */
    width: fit-content;
    max-width: 90%;
    margin-left: auto; /* 确保靠右对齐 */
}

.chat-input {
    display: flex;
    padding: 10px;
    /*border-top: 1px solid #ddd;*/
    background-color: white;
    position: sticky; /* 固定位置 */
    bottom: 0; /* 粘性定位的底部偏移 */
    z-index: 10; /* 确保在最上层 */
}

#chat-input {
    flex: 1;
    padding: 20px; /* 增加内边距，使输入框更高 */
    border: 2px solid #4d6bfe; /* 蓝色边框 */
    /*border: 1px solid #ddd;*/
    border-radius: 25px; /* 圆角 */
    margin-right: 10px;
    width: calc(100% - 60px); /* 留出空间给发送按钮 */
    outline: none; /* 移除默认的焦点边框 */
}

#chat-input:focus {
    border-color: #4d6bfe; /* 选中时边框颜色保持为蓝色 */
    box-shadow: 0 0 0 2px rgba(77, 107, 254, 0.3); /* 添加轻微的阴影效果 */
}

#send-btn {
    padding: 10px 20px;
    background-color: #4d6bfe;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

#send-btn:hover {
    background-color: #4166d5;
}